export type PabContact = {
  id: string;
  emails: string[];
  name?: string;
  orgName?: string;
  mobilePhone?: string;
  phoneHome?: string,
  phoneWork?: string,
  addrHome?: string;
  addrWork?: string;
  postCodeHome?: string;
  postCodeWork?: string;
  birthday?: string;
  rev: number;
  groups?: string[];
  fax?: string;
  im?: string;
  url?: string;
  location?: string;
  duty?: string;
  remark?: string;
  gender?: number;
  ou?: string,
  type?: string
}

export type PabGroup = {
  name: string;
  id: string;
  contacts: PabContact[]
  reserved: boolean;
}
export type PersonalAddressBook = {
  groups: PabGroup[]
}

// 组织通讯录部门
export type Organization = {
  id: string,
  name: string,
  email: string,
  ou?: Organization[]
}

export enum ContactAttr {
  name = "true_name",
  pab_name = "FN",
  oab_email = "email",
  pab_email = "EMAIL;PREF",
  oab_id = "@id",
  pab_id = "id",
  mobileNumber = "mobile_number",
  companyPhone = "company_phone",
  homePhone = "home_phone",
  address = "address",
  ou = "@ou",
  location = "@location",
  duty = "duty",
  zipcode = "zipcode",
  remarks = "remarks",
  fax = "fax_number",
  attr_type = "@type",
  gender = "gender",
  groups = "groups"
}

// 组织通讯录成员类型枚举
export enum OabContactType {
  User = "U", // 普通用户
  Extra = "X", // 外部联系人
  List = "L", // 邮件列表
  Room = "R", // 会议室
}

export const MAX_EMAIL_COUNT = 10;

export const DIGEST_SIZE = 10;

export type OabDirectory = {}


export enum RecallStatus {
  NONE = 0,
  PARTIAL = 1,
  All = 2
}

export type CmAliasWithSeed = {
  id: string,
  fid: number,
  color: number,
  name: string
}

export type Cal = {
  id: string;
  color: string;
  name: string;
}

export type CalGroup = {
  name: string;
  id: string;
  calendars: Cal[];
}

export interface CoreMailObj {
  callFunc: (func: string, args: string) => void;
}
